package com.thti.mecool.client.adapter;

import java.util.HashMap;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.thti.mecool.client.activity.R;

public class AddPlanAdapter extends BaseAdapter {

	private Context mContext;
	private HashMap<Integer, String> Projects;
	public AddPlanAdapter(Context mContext,HashMap<Integer, String> Projects) {
		super();
		this.mContext = mContext;
		this.Projects=Projects;
	}

	@Override
	public int getCount() {
		return Projects.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return Projects.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View view =((Activity) mContext).getLayoutInflater().inflate(R.layout.mecool_plan_add_item,null);
		TextView textView;
		try {
			view.setTag(position);
			textView=(TextView)view.findViewById(R.id.mecool_plan_add_item_content);
			textView.setText(Projects.get(position));
		
		} catch (Exception e) { 
			// TODO: handle exception
		}
		return view;
	}

}
